/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package phongtro.webservice;

import com.google.gson.Gson;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import model.service.*;
import model.entity.*;
import java.util.*;
import model.dao.PhongTroDAO;
import model.dao.QuanDAO;
import org.json.JSONArray;
import org.json.JSONObject;

@Path("quanwebservice")
public class QuanWebservice {

    QuanDAOService quanService = QuanDAO.getInstance();
    PhongTroDAOService phongService = PhongTroDAO.getInstance();

    @GET
    @Path("/sayhello")
    public String hello() {
        return "Hello";
    }

    @GET
    @Path("/listquan")
    public String getListQuan() {
        try {
            List<Quan> listQuan = quanService.getAllQuan();
            Gson jGson = new Gson();
            return jGson.toJson(listQuan);
        } catch (Exception e) {
        }
        return null;
    }

    
}
